package bai5.model;

import java.util.Scanner;

public class Position {
	private String name;
	private String nameEmp;
	private String location;
	private int salary;
	public Position(){
		
	}
	public Position(String name, String nameEmp, String location, int salary) {
		super();
		this.name = name;
		this.nameEmp = nameEmp;
		this.location = location;
		this.salary = salary;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNameEmp() {
		return nameEmp;
	}
	public void setNameEmp(String nameEmp) {
		this.nameEmp = nameEmp;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public int getSalary() {
		return salary;
	}
	public void setSalary(int salary) {
		this.salary = salary;
	}
	public Position inputPosition(){
		Scanner ip=new Scanner(System.in);
		System.out.println("=====Them moi Position=====");
		System.out.println("Nhap name:");
		String name=ip.nextLine();
		while(name.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			name=ip.nextLine();
		}
		System.out.println("Nhap nameEmp:");
		String nameEmp=ip.nextLine();
		while(nameEmp.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			nameEmp=ip.nextLine();
		}
		System.out.println("Nhap location:");
		String location=ip.nextLine();
		while(location.trim().equalsIgnoreCase("")){
			System.out.println("Chua nhap gia tri");
			location=ip.nextLine();
		}
		System.out.println("Nhap salary: ");
		int salary=ip.nextInt();
		
		Position ps=new Position(name,nameEmp,location,salary);
		return ps;
		
	}
	public void display(Position ps){
		System.out.println("Name: "+ps.name);
		System.out.println("NameEmp: "+ps.nameEmp);
		System.out.println("Location: "+ps.location);
		System.out.println("Salary: "+ps.salary);
	}
	

}
